home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
batchut
/
jumpext.zip
/
JUMPEXT.DOC
< prev
next >
Wrap
Text File
|
1989-06-21
|
9KB
|
202 lines
JumpExt
V1.0 19-Jun-1989
Copyright (C) 1989 by Simple Solutions, Inc.
All Rights Reserved
A Shareware Product
from
Simple Solutions, Inc.
P.O. Box 640189
Kenner, LA 70064
(504) 464-5748
Written by
Mark W. Geisinger
CIS 76440,76
GEnie M.GEISINGER
JumpExt comes from a need I have to do some decision making in my autoexec.bat
file and, as the name implies, is an extension of the original utility, Jump,
which I released into the public domain.
JumpExt retains the original flavor of Jump, in that it allows you to do some
simple decision making in batch files (with a time-out default) based on the
error level set by the program. JumpExt provides some extensions to the
original program which I hope you will find useful.
Jump-Ext is a copyrighted work and has been released for distribution as
SHAREWARE. Please read the file LICENSE.DOC before using Jump-Ext.
Usage:
------
JumpExt should be executed in the following manner:
jumpext [-b [-f param_filename] ] prompt
Brackets indicate optional parameters.
Parameters:
-b Bell
Is a switch which will cause JumpExt to sound the all to
irritating bell when it is executed. The default is off,
that is no bell or other noise is made.
-f Use Action file
JumpExt is capable of executing a program based on info in
a action file. When used this switch requires the
complete pathname (including the filename) to the action
file (ie. -f c:\bin\param.jmp). You may use any legal filename
you choose, which allows for as many of these action files
as you may have a need for when using JumpExt several times or
in several batch files. This file is simply a text file and
its use is fully explained below.
prompt
This is a text prompt that you pass to JumpExt and it uses
as its user prompt when executed. Enclose the text of the
prompt in double quotes if there are embedded spaces.
JumpExt operates in the following manner. When executed, it will display the
prompt on the screen and check for a single key input (the letter 'y', in
upper or lower case is what it looks for) from the user. This is done by
first checking the keyboard buffer for a waiting keystroke. If there is one,
action is taken based on that key. This allows you to enter your response to
JumpExt before it is actually executed (in a running batch file of course).
If there is no waiting keystroke a timing loop is begun while waiting for a
response. This timer waits approximately 7 sec. on a 13 mhz. AT (your milage
will surely vary). Entering a keystroke or timing out causes the next
action.
What JumpExt does next is based on keyboard input and the command line
switches passed to the program. The simplest case is where JumpExt is called
with only the prompt parameter. Typing the letter 'y' (case insensitive) at
the keyboard will cause JumpExt to exit to DOS, setting the errorlevel to 1.
Timing out or any other keyboard response will cause JumpExt to exit with
errorlevel set to 0. You may then use the errorlevel value for branching in
your batch file. If the -f switch was used and you type 'y' at the keyboard,
then JumpExt operates on the action file. Using the -f switch and any other
keyboard response or timing out causes JumpExt to exit to DOS with errorlevel
set to 0.
Consider this fragment from my autoexec file:
jumpext "Skip installation of resident programs? "
if errorlevel 1 goto nores
c:\bin\fastbuff /b50/v5/d4
c:\bin\newkeys
MIRROR c: d: e: /1 /tc /td-400 /te-400 /tf /tg >nul
PC-CACHE /IA /IB /SIZEXT=384K >nul
:nores
continues here....
What happens here is that answering the prompt in the affirmative ('y')
causes execution of the batch file to jump to the "nores" label, skipping the
stuff above. Any other response, or just ignoring it while you get another
cup of coffee, causes the execution of the lines after the "if errorlevel"
statement (what I usually want done).
You will notice that the prompt is enclosed in quotes. This is necessary is
you wish to have embedded spaces in your prompt (which will normally be the
case).
Another example of how to use JumpExt:
jumpext -b -f c:\bin\jumpext.prm "Install Norton Guides? "
This line is the second usage of JumpExt in my autoexec.bat file. In this
case, I use the -b switch to wake me up and the -f switch for an action
filename. If I do nothing, or respond with a key other than 'y', then JumpExt
exits with errorlevel set to 0. if I respond with a 'y', then the first line
in the action file is used to execute a program. In this particular case, my
action file simply contains single line necessary to install the Norton
Guides. I take no further action in the batch file for this usage of
JumpExt.
Consider the single key response and your own personal prompts, and you'll
see that this allows for considerable flexibility. If you use prompts and
resulting actions that allow for your most frequent response to be other than
the affirmative 'y', you can be lazy like me and just slap the space bar or
ignore the program most of the time. For example, I usually want the
resident stuff installed, so a prompt that asks if I want to skip this
installation of resident utilities and the logic used in the batch file allow
me to be lazy most of the time.
Action Files:
-------------
The Action file is simply a text file which JumpExt uses to get a command
line used to execute another program. In its present form JumpExt uses the
first line of the Action file only. This line is expected to be a command
line used to execute a program or another utility. JumpExt will execute this
other program for you, using the command line in the Action file. You may
create the Action file with any text editor or word processor capable of
saving a file as ASCII text. The first line of the file should be the
command line used to start the program you want executed and should be
entered exactly as you would enter it at the DOS prompt.
At this point JumpExt is capable of executing a single program from the
Action file. It has occurred to me that it may be desirable to have several
other options available to you. For instance, control does not return to
JumpExt after executing a program for you. In fact, JumpExt is removed from
memory when the other program is run. While there are certainly instances
where this is desirable (when installing a TSR for instance), I've considered
that it may be useful to allow JumpExt to execute as many commands as you
like from the Action file. It may also be useful to allow you to use JumpExt
and an Action file to run more than one program or execute regular DOS
commands.
I would be interested in your opinion on the usefulness of these ideas, and
certainly any other suggestions or comments you may have about JumpExt. If
there is something you would like JumpExt to do, let me know. If I get
enough interest in a particular feature or enhancement chances are that it
will appear in a future version.
A word on TSRs and JumpExt:
---------------------------
TSRs may be the single most useful and sometimes unpredictable class of
programs around. I use JumpExt regularly to install the Norton Guides from
an Action file, as shown in the example above. I have also tested it with
the other major TSR package that I use, PC-TOOLS V5.1. I haven't encountered
any problems installing these resident programs with Ju